package com.baidu.noah.zeus.vo;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class HeartbeatResponse implements Writable {
	
	// 可能会一次性下发多个任务
	// 每个任务需要一个vo表示，做成数组即可
	private boolean hasTask = false;
	private long taskId;
	private String execFileContent;
	
	public HeartbeatResponse() {}
	
	public HeartbeatResponse(boolean hasTask, long taskId, String execFileContent) {
		this.hasTask = hasTask;
		this.taskId = taskId;
		this.execFileContent = execFileContent;
	}

	@Override
	public void readFields(DataInput in) throws IOException {
		this.hasTask = in.readBoolean();
		this.taskId = in.readLong();
		this.execFileContent = in.readUTF();
	}

	@Override
	public void write(DataOutput out) throws IOException {
		out.writeBoolean(hasTask);
		out.writeLong(taskId);
		out.writeUTF(execFileContent);
	}

	public boolean isHasTask() {
		return hasTask;
	}

	public void setHasTask(boolean hasTask) {
		this.hasTask = hasTask;
	}

	public long getTaskId() {
		return taskId;
	}

	public void setTaskId(long taskId) {
		this.taskId = taskId;
	}

	public String getExecFileContent() {
		return execFileContent;
	}

	public void setExecFileContent(String execFileContent) {
		this.execFileContent = execFileContent;
	}
	
}
